package cn.com.nes.site.controller.product;

import cn.com.nes.mybatis.agent.ope.entity.Sblx;
import cn.com.nes.site.entity.PageData;
import cn.com.nes.site.service.product.SblxMaintenanceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;


@Controller
@RequestMapping("/sblx")
public class SblxMaintenanceController {
	/**
	 * SBLX维护服务
	 */
	@Autowired
	private SblxMaintenanceService sblxMaintenanceService;
	
	/**
	 * 添加设备类型
	 * @param sblxVo
	 * @return
	 */
	
	@RequestMapping(value = "/saveSblx",method = RequestMethod.POST)
	@ResponseBody
	public PageData addSblx(@RequestBody Sblx sblxVo) {
		sblxVo.setCompanyId(sblxVo.getUserInfo().getNes_companyId());
		sblxVo.setRoleId(sblxVo.getUserInfo().getRole_id());
		return sblxMaintenanceService.addSblx(sblxVo);
	}
	
	/**
	 *查询设备类型
	 * @param sblxVo
	 * @return
	 */
	
	@RequestMapping(value = "/selectSblx",method = RequestMethod.POST)
	@ResponseBody
	public PageData selectSblx(@RequestBody Sblx sblxVo, HttpServletRequest httpRequest) {
		sblxVo.setCompanyId(sblxVo.getUserInfo().getNes_companyId());
		sblxVo.setRoleId(sblxVo.getUserInfo().getRole_id());
		return sblxMaintenanceService.selectSblx(sblxVo);
	}
	/**
	 * 删除设备类型
	 * @param sblxVo
	 * @return
	 */
	@RequestMapping(value = "/deleteSblx",method = RequestMethod.POST)
	@ResponseBody
	public PageData deleteSblx(@RequestBody Sblx sblxVo) {
		sblxVo.setCompanyId(sblxVo.getUserInfo().getNes_companyId());
		sblxVo.setRoleId(sblxVo.getUserInfo().getRole_id());
		return sblxMaintenanceService.deleteSblx(sblxVo);
	}
	
}
